-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Reflect for PhantomData #15313
Implement Reflect for PhantomData #15313
Conversation
I'm curious why we want this now and not before. |
It's still the same issues as before. I think the biggest problem is serialization. It really only adds noise to the serialized output. And if we make it If we do this, we may want to consider skipping it during serialization (and other operations such as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, can we add a serialization test for PhantomData
in the serde
module? Whether or not we're allowing this type to be serialized, we should ensure any type containing it can be deserialized and FromReflect
-ed.
do we want really need this? i feel like tldr; the implementation is correct but i'm not sure the feature is desirable. |
Maybe it would be better to instead implement a way to always ignore marker types? |
I don't know how to fix the unit test. Someone else can give me a pointer or do it themselves if they want. :) |
Could there be a way of saying to ignore a whole type when you register it? |
Yeah, that would be my preferred solution here. |
Objective
Solution
Testing
N/A
I don't see tests for the other
core
impl_reflect
s.